// FILE: Interupt_Buzzer.h by Richard Hughes 17/05/2012
//
// DESC: Defines the buzzer interupt

#ifndef __interupt_buzzer_h__
#define __interupt_buzzer_h__

// INCLUDES
#include "IInterupt.h"
#include "InteruptType.h"
#include "Chip8Buzzer.h"

// NAMESPACES
namespace Emulator
{
namespace Chip8
{

/*************************************************************/
//
// CLASS: Interupt_Buzzer
//
// DESC: Defines the buzzer interupt
//
/*************************************************************/

class Interupt_Buzzer : public IInterupt
{
private:

	bool _play;

public:

	Interupt_Buzzer(bool play)
		: _play(play)
	{
	}
	~Interupt_Buzzer() {}

	void Action(IInteruptableDevice* device)
	{
		if(this->_play)
			((Chip8Buzzer*)device)->Play();
		else
			((Chip8Buzzer*)device)->Stop();
	}

	int GetType() { return InteruptType_Buzzer; }

}; // Chip8CPU

} // Chip8
} // Emulator

#endif // __interupt_clearscreen_h__

// EOF: Interupt_ClearScreen.h